//
// Created by yk120 on 2024/3/1.
//

#ifndef NANOFAISS_RANDOM_H
#define NANOFAISS_RANDOM_H

#include <stdint.h>
#include <random>

namespace faiss {

struct RandomGenerator {
    std::mt19937 mt;

    /// random positive integer
    int rand_int();

    int64_t rand_int64();

    /// random positive integer under max
    int rand_int(int max);

    /// 0 - 1
    float rand_float();

    double rand_double();

    explicit RandomGenerator(int64_t seed = 1234);
};

/** random permulation */
void rand_perm(int *perm, size_t n, int64_t seed);
}

#endif // NANOFAISS_RANDOM_H
